import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/coupon',
    name: 'coupon',
    meta,
    redirect: { name: 'coupon' },
    component: layoutHeaderAside,
    children: (pre => [
        // {
        //     path: 'couponBonusRuleList',
        //     name: `${pre}couponBonusRuleList`,
        //     component: _import('activity/couponBonusRuleList'),
        //     meta: {
        //         ...meta,
        //         title: '消费券赠送规则'
        //     }
        // },
		{
            path: 'couponBonusRecordList',
            name: `${pre}couponBonusRecordList`,
            component: _import('activity/couponBonusRecordList'),
            meta: {
                ...meta,
                title: '消费券赠送记录'
            }
        },
		{
            path: 'productCouponList',
            name: `${pre}productCouponList`,
            component: _import('coupon/productCouponList'),
            meta: {
                ...meta,
                title: '消费券商品列表'
            }
        },
		{
            path: 'productCouponLogList',
            name: `${pre}productCouponLogList`,
            component: _import('coupon/productCouponLogList'),
            meta: {
                ...meta,
                title: '消费券变更历史'
              }
        },
		{
            path: 'orderCouponList',
            name: `${pre}orderCouponList`,
            component: _import('coupon/orderCouponList'),
            meta: {
                ...meta,
                title: '消费券订单列表'
              }
        },
        {
            path: 'productCouponCpList',
            name: `${pre}productCouponCpList`,
            component: _import('coupon/productCouponCpList'),
            meta: {
                ...meta,
                title: '消费券合作管理'
            }
        },
        {
            path: 'productCouponCpAdd',
            name: `${pre}productCouponCpAdd`,
            component: _import('coupon/productCouponCpAdd'),
            meta: {
                ...meta,
                title: '新增消费券合作'
            }
        },
        {
            path: 'productCouponCpUpdate',
            name: `${pre}productCouponCpUpdate`,
            component: _import('coupon/productCouponCpUpdate'),
            meta: {
                ...meta,
                title: '编辑消费券合作'
            }
        },
        {
            path: 'productCouponCpDetail',
            name: `${pre}productCouponCpDetail`,
            component: _import('coupon/productCouponCpDetail'),
            meta: {
                ...meta,
                title: '消费券合作详情'
            }
        }
    ])('coupon-')
}
